package th.ac.tu.engr.timemylife;

import android.app.Application;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.content.Context;
import android.os.Handler;
import android.os.Bundle;
import android.os.Message;


public class MyApp extends Application {
    private static final String TAG = "MyApp";
    private static SharedPreferences appPref;
    private static MyDbHelper appDbHelper;
    private static SQLiteDatabase appDb;
    private static Context appContext;

    @Override
    public void onCreate() {
        super.onCreate();
        appPref = getSharedPreferences("settings", MODE_PRIVATE);
        appDbHelper = new MyDbHelper(getApplicationContext());
        appDb = appDbHelper.getReadableDatabase();
        appContext = getApplicationContext();
    }

    public static Context getAppContext() {
        return appContext;
    }

    public static SharedPreferences getAppPreference() {
        return appPref;
    }

    public static SQLiteDatabase getAppDb() {
        return appDb;
    }
}
